package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.HotMessageMapper;
import com.ruoyi.manage.domain.HotMessage;
import com.ruoyi.manage.service.IHotMessageService;

/**
 * 热点信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-09
 */
@Service
public class HotMessageServiceImpl implements IHotMessageService 
{
    @Autowired
    private HotMessageMapper hotMessageMapper;

    /**
     * 查询热点信息
     * 
     * @param id 热点信息ID
     * @return 热点信息
     */
    @Override
    public HotMessage selectHotMessageById(Long id)
    {
        return hotMessageMapper.selectHotMessageById(id);
    }

    /**
     * 查询热点信息列表
     * 
     * @param hotMessage 热点信息
     * @return 热点信息
     */
    @Override
    public List<HotMessage> selectHotMessageList(HotMessage hotMessage)
    {
        return hotMessageMapper.selectHotMessageList(hotMessage);
    }

    /**
     * 新增热点信息
     * 
     * @param hotMessage 热点信息
     * @return 结果
     */
    @Override
    public int insertHotMessage(HotMessage hotMessage)
    {
        hotMessage.setCreateTime(DateUtils.getNowDate());
        return hotMessageMapper.insertHotMessage(hotMessage);
    }

    /**
     * 修改热点信息
     * 
     * @param hotMessage 热点信息
     * @return 结果
     */
    @Override
    public int updateHotMessage(HotMessage hotMessage)
    {
        return hotMessageMapper.updateHotMessage(hotMessage);
    }

    /**
     * 批量删除热点信息
     * 
     * @param ids 需要删除的热点信息ID
     * @return 结果
     */
    @Override
    public int deleteHotMessageByIds(Long[] ids)
    {
        return hotMessageMapper.deleteHotMessageByIds(ids);
    }

    /**
     * 删除热点信息信息
     * 
     * @param id 热点信息ID
     * @return 结果
     */
    @Override
    public int deleteHotMessageById(Long id)
    {
        return hotMessageMapper.deleteHotMessageById(id);
    }
}
